package com.codeoss.framework.view.renderer;

import org.springframework.stereotype.Service;

import com.codeoss.framework.context.YunContext;
import com.codeoss.framework.view.component.Component;
import com.codeoss.framework.view.component.chart.HBarChart;
import com.fasterxml.jackson.databind.node.ObjectNode;

@Service("hbarchartRenderer")
public class HBarChartRenderer extends AbstractChartRenderer {
	protected void startRenderView(YunContext yunContext, Component component, ViewSerializeMap viewSerializeMap) {
		super.startRenderView(yunContext, component, viewSerializeMap);
		HBarChart hBarChart=(HBarChart)component;
		viewSerializeMap.put("title", hBarChart.getTitle());
		viewSerializeMap.put("subtitle", hBarChart.getSubtitle());
		viewSerializeMap.put("col", hBarChart.getCol());
		viewSerializeMap.put("bigScreen", hBarChart.isBigScreen());
	}
	
	protected PropSerializeMap startRenderProp(YunContext yunContext,
			Component component, ViewPropMap viewPropMap) {
		PropSerializeMap propSerializeMap=super.startRenderProp(yunContext, component, viewPropMap);
		ObjectNode option=getRenderValue(yunContext, component);
		propSerializeMap.put("option", option);
		return propSerializeMap;
	}
}
